package plugins.openform;

import kd.bos.base.AbstractBasePlugIn;
import kd.bos.base.BaseShowParameter;
import kd.bos.bill.OperationStatus;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.form.FormShowParameter;
import kd.bos.form.events.PreOpenFormEventArgs;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;

import java.util.Map;

/**
 * 基础资料插件
 */
public class OpenSchoolCard_inVisable extends AbstractBasePlugIn implements Plugin {

    @Override
    public void preOpenForm(PreOpenFormEventArgs e) {
        super.preOpenForm(e);

        // 1. 获取入口参数
        Map<String, Object> customParams = e.getFormShowParameter().getCustomParams();
        String identity = (String) customParams.get("Identity");

        // 2. 检查参数是否为"user"
        if ("user".equals(identity)) {
            // 隐藏dcb4_lock和dcb4_unlock按钮
            this.getView().setVisible(false, "dcb4_lock", "dcb4_unlock");
        }
    }
}
